<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib prefix="his_fns" uri="/WEB-INF/tlds/his_fns.tld" %>
<script>
    autoCompleteDiagnosis('diagnosis');
    /*诊断数据自动补全*/
    function autoCompleteDiagnosis(inputId){
        var url=ctx+"/doctor/hisDataIcd10/automaticIcd";
        autoComplete(inputId,url,
            function(data){
                var rows = [];
                for(var i=0; i<data.length; i++){
                    rows[rows.length] = {
                        data:data[i],
                        value:data[i].id,
                        result:data[i].keywordShuoming
                    };
                }
                return rows;
            },function(data, i, max){
                return data.keywordShuoming;
            },function(event,data,formatted){
                $('#'+inputId).attr('value',data.zhongwenMingcheng);
            });
    }
</script>
<form:form id="inputForm" data-parsley-validate="" modelAttribute="turnInVo"  onsubmit="return formSaveTurnInLoad('mainCenterDiv','inputForm','${ctx}/nurse/wardCirculation/turnIn','${ctx}/doctor/patVisit/index')" method="post" class="form-horizontal">
    <form:hidden path="id"></form:hidden>
    <form:hidden path="patVisitId"/>
    <form:hidden path="patientId"/>
    <form:hidden path="bedRecId" id="bedId"/>
    <input type="hidden" name="wardCode" value="${turnInVo.ward.id}">
    <div class="form-group">
        <label class="col-sm-2 control-label">身份证号：</label>
        <div class="col-sm-4">
            <form:input path="idNo" id="idNo" htmlEscape="false" class="form-control"  data-parsley-checkidcard="3"   maxlength="21" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">床号：</label>
        <div class="col-sm-4">
            <form:input path="bedNo" id="bedNo" htmlEscape="false" class="form-control"  maxlength="21" readonly="true" />
        </div>
        <label class="col-sm-2 control-label">床标号：</label>
        <div class="col-sm-4">
            <form:input path="bedLabel" htmlEscape="false" class="form-control"  maxlength="21" readonly="true" />
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">姓名：</label>
        <div class="col-sm-4">
            <form:input path="name" id="name" htmlEscape="false" class="form-control"  maxlength="200" readonly="true"/>
        </div>
        <label class="col-sm-2 control-label">性别：</label>
        <div class="col-sm-4">
            <form:select path="sex" id="sex" class="form-control" data-parsley-required="true"  disabled="true">
                <form:options items="${fns:getDictList('SEX_DICT')}" itemLabel="label" itemValue="value"  htmlEscape="false"/>
            </form:select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">住院号：</label>
        <div class="col-sm-4">
            <form:input path="visitNo" htmlEscape="false" class="form-control"  maxlength="21" readonly="true"/>
        </div>
        <label class="col-sm-2 control-label">费别：</label>
        <div class="col-sm-4">
            <form:select path="chargeType" id="chargeType" class="form-control" data-parsley-required="true" disabled="true">
                <form:options items="${fns:getDictList('CHARGE_TYPE_DICT')}" itemLabel="label" itemValue="value"  htmlEscape="false"/>
            </form:select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">预交金：</label>
        <div class="col-sm-4">
            <form:input path="prepayments" htmlEscape="false" class="form-control"  maxlength="21" readonly="true"/>
        </div>
        <label class="col-sm-2 control-label">累计费用：</label>
        <div class="col-sm-4">
            <form:input path="totalCosts" htmlEscape="false" class="form-control"  maxlength="21" readonly="true"/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">入院日期：</label>
        <div class="col-sm-4">
            <%--<form:input path="admissionDate" htmlEscape="false" class="form-control Wdate"  maxlength="21" />--%>
                <input name="admissionDate" class="form-control Wdate" id="admissionDate"  readonly  value='<fmt:formatDate value="${turnInVo.admissionDate}" pattern="yyyy-MM-dd"/>' />
        </div>
        <label class="col-sm-2 control-label">入区时间：</label>
        <div class="col-sm-4">
            <input name="enterWardDate" class="form-control Wdate" id="enterWardDate"  readonly onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value='<fmt:formatDate value="${turnInVo.enterWardDate}" pattern="yyyy-MM-dd HH:mm:ss"/>' />

        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">入院身高：</label>
        <div class="col-sm-4">
            <form:input path="height" htmlEscape="false" class="form-control"  maxlength="21"  data-parsley-type="number"/>
        </div>
        <label class="col-sm-2 control-label">入院体重：</label>
        <div class="col-sm-4">
            <form:input path="weight" htmlEscape="false" class="form-control"  maxlength="21" data-parsley-type="number"/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">责任护士：</label>
        <div class="col-sm-4">
            <input type="hidden" name="dutyNurse" value="${user.id}">
            <input type="text"  value="${user.name}" class="form-control" readonly>
        </div>
        <label class="col-sm-2 control-label">质控护士：</label>
        <div class="col-sm-4">
            <select name="qualityNurse" class="form-control">
                <c:forEach items="${users}" var="u">
                    <option value="${u.id}" <c:if test="${turnInVo.qualityNurse eq u.id}" >selected</c:if>>${u.name}</option>
                </c:forEach>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">诊断：</label>
        <div class="col-sm-4">
            <form:input path="diagnosis" id="diagnosis" htmlEscape="false" class="form-control"   />
        </div>
        <label class="col-sm-2 control-label"></label>
        <div class="col-sm-4">
            <div class="demo-button">
                <input id="btnSubmit" class="btn btn-success btn-rounded col-lg-12" type="submit" value="保 存">
            </div>

        </div>
    </div>

</form:form>


<script src="${ctxStatic}/js/nurse/nurse_turnInForm.js"></script>
